//
//  SKTagView.h
//
//  Created by Day Ling on 15/1/12.
//  Copyright (c) 2015 Day Ling. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SKTag.h"

typedef void(^LabelBlock)(CGFloat);
@interface SKTagView : UIView

@property (assign, nonatomic) UIEdgeInsets padding;
@property (assign, nonatomic) CGFloat lineSpacing;
@property (assign, nonatomic) CGFloat interitemSpacing;
@property (assign, nonatomic) CGFloat preferredMaxLayoutWidth;
@property (assign, nonatomic) CGFloat regularWidth; //!< 固定宽度
@property (nonatomic, assign) CGFloat regularHeight; //!< 固定高度
@property (nonatomic, assign) SKTagViewStyle tagViewStyle;//是否可以进行多选
@property (assign, nonatomic) BOOL singleLine;
@property (copy, nonatomic, nullable) void (^didTapTagAtIndex)(NSUInteger index , UIButton * _Nonnull bnt);

@property(nonatomic,copy) LabelBlock labelblock;
@property(nonatomic,assign) CGFloat allWidth;

- (void)addTag: (nonnull SKTag *)tag;
- (void)insertTag: (nonnull SKTag *)tag atIndex:(NSUInteger)index;
- (void)removeTag: (nonnull SKTag *)tag;
- (void)removeTagAtIndex: (NSUInteger)index;
- (void)removeAllTags;

- (void)initNoWithType:(SKTagViewStyle)type data:(NSArray *)dataArray;
-(CGFloat)calculateWidthArr:(NSArray *)arr;
/**
 top 上 left 左 bottom 下 right 右 lrmogi 左右间隙 tbmogi 上下间隙 rowHeight cell高度
 */
-(void)setUpUIEdgeInsetstop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right lrmogi:(CGFloat)lrmogi tbmogi:(CGFloat)tbmogi rowHeight:(CGFloat)rowHeight;

/**
borderColor 边框和字体颜色
bgcolor 背景颜色
 */
-(void)setUpBorderColor:(UIColor *)borderColor baColor:(UIColor *)bgcolor;

/**
 fsize 字体大小
 borderWidth 边框宽度
 corderRadius 边框倒角
 tagmogi 标签的左右內边距
 */
-(void)setUpLabelFont:(CGFloat)fsize borderWidth:(CGFloat)borderWidth corderRadius:(CGFloat)corderRadius tagmogi:(CGFloat)tagmogi;
@end

